package alejandro.castro.asteroid.components;


import alejandro.castro.abstracts.ShooterComponent;

import com.uqbar.vainilla.appearances.Sprite;

public class Ship extends ShooterComponent {
	
	Sprite appearance;

	public Ship(double x, double y) {
		super(x, y);
		setNormalSprite();
	}

	@Override
	public double getWidth() {
		return 36;
	}

	@Override
	public double getHeight() {
		return 36;
	}
	
	@Override
	public void updateRenderAngle() {		
		this.setAppearance(this.appearance.rotate(this.getSpriteAngle()));		
	}

	private void setNormalSprite() {
		this.appearance = Sprite.fromImage("/images/ship.png");
		updateRenderAngle();
	}
	
	@Override
	public void setTopEstate() {
		super.setTopEstate();
		this.appearance = Sprite.fromImage("/images/ship2.png");
		updateRenderAngle();
	}
	
	@Override
	public void setBottomEstate() {
		super.setBottomEstate();
		setNormalSprite();
	}
	
	@Override
	public void setNoneEstadoV() {
		super.setNoneEstadoV();
		setNormalSprite();
	}

}
